package com.hjm.project.channel.picturesInfo.service.impl;

import java.util.List;
import com.hjm.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.hjm.project.channel.picturesInfo.mapper.AgentPicturesInfoMapper;
import com.hjm.project.channel.picturesInfo.domain.AgentPicturesInfo;
import com.hjm.project.channel.picturesInfo.service.IAgentPicturesInfoService;
import com.hjm.common.utils.text.Convert;

import javax.annotation.Resource;

/**
 * 代理商图片信息Service业务层处理
 * 
 * @author maker-platform
 * @date 2025-05-27
 */
@Service
public class AgentPicturesInfoServiceImpl implements IAgentPicturesInfoService {
    @Resource
    private AgentPicturesInfoMapper agentPicturesInfoMapper;

    /**
     * 查询代理商图片信息
     * 
     * @param id 代理商图片信息ID
     * @return 代理商图片信息
     */
    @Override
    public AgentPicturesInfo selectAgentPicturesInfoById(String id) {
        return agentPicturesInfoMapper.selectAgentPicturesInfoById(id);
    }

    /**
     * 查询代理商图片信息列表
     * 
     * @param agentPicturesInfo 代理商图片信息
     * @return 代理商图片信息
     */
    @Override
    public List<AgentPicturesInfo> selectAgentPicturesInfoList(AgentPicturesInfo agentPicturesInfo) {
        return agentPicturesInfoMapper.selectAgentPicturesInfoList(agentPicturesInfo);
    }

    /**
     * 查询代理商图片信息列表
     *
     * @param agentPicturesInfo 代理商图片信息
     * @return 代理商图片信息 一个结果
     */
    @Override
    public AgentPicturesInfo selectAgentPicturesInfoOne(AgentPicturesInfo agentPicturesInfo) {
        return agentPicturesInfoMapper.selectAgentPicturesInfoOne(agentPicturesInfo);
    }

    /**
     * 新增代理商图片信息
     * 
     * @param agentPicturesInfo 代理商图片信息
     * @return 结果
     */
    @Override
    public int insertAgentPicturesInfo(AgentPicturesInfo agentPicturesInfo) {
        agentPicturesInfo.setCreateTime(DateUtils.getNowDate());
        return agentPicturesInfoMapper.insertAgentPicturesInfo(agentPicturesInfo);
    }

    /**
     * 修改代理商图片信息
     * 
     * @param agentPicturesInfo 代理商图片信息
     * @return 结果
     */
    @Override
    public int updateAgentPicturesInfo(AgentPicturesInfo agentPicturesInfo) {
        agentPicturesInfo.setUpdateTime(DateUtils.getNowDate());
        return agentPicturesInfoMapper.updateAgentPicturesInfo(agentPicturesInfo);
    }

    /**
     * 删除代理商图片信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAgentPicturesInfoByIds(String ids) {
        return agentPicturesInfoMapper.deleteAgentPicturesInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除代理商图片信息信息
     * 
     * @param id 代理商图片信息ID
     * @return 结果
     */
    @Override
    public int deleteAgentPicturesInfoById(String id) {
        return agentPicturesInfoMapper.deleteAgentPicturesInfoById(id);
    }

    @Override
    public int deleteAgentPicturesInfoByAgentId(String agentId) {
        return agentPicturesInfoMapper.deleteAgentPicturesInfoByAgentId(agentId);
    }
}
